using System;
using System.Xml.Serialization;
using System.Globalization;

namespace org.nativeinstruments.nml
{
	
	public class INFO
	{
		// ATTRIBUTES
		[XmlIgnore]
		public int? BITRATE { get; set; }
		[XmlAttribute("BITRATE")]
		public string BITRATEString
		{
			get { return BITRATE==null ? "" : BITRATE.Value.ToString(CultureInfo.InvariantCulture); }
			set
			{
				if (String.IsNullOrWhiteSpace(value)) BITRATE = null;
				else BITRATE = int.Parse(value);
			}
		}
		
		[XmlAttribute("GENRE")]
		public string GENRE { get; set; }
		
		[XmlAttribute("KEY")]
		public string KEY { get; set; }
		
		[XmlIgnore]
		public int? PLAYTIME { get; set; }
		[XmlAttribute("PLAYTIME")]
		public string PLAYTIMEString
		{
			get { return PLAYTIME==null ? "" : PLAYTIME.Value.ToString(CultureInfo.InvariantCulture); }
			set
			{
				if (String.IsNullOrWhiteSpace(value)) PLAYTIME = null;
				else PLAYTIME = int.Parse(value);
			}
		}
		
		[XmlIgnore]
		public double? PLAYTIME_FLOAT { get; set; }
		[XmlAttribute("PLAYTIME_FLOAT")]
		public string PLAYTIME_FLOATString
		{
			get { return PLAYTIME_FLOAT==null ? "" : PLAYTIME_FLOAT.Value.ToString(CultureInfo.InvariantCulture); }
			set
			{
				if (String.IsNullOrWhiteSpace(value)) PLAYTIME_FLOAT = null;
				else PLAYTIME_FLOAT = double.Parse(value);
			}
		}
		
		[XmlAttribute("IMPORT_DATE")]
		public string IMPORT_DATE { get; set; }
		
		[XmlAttribute("RELEASE_DATE")]
		public string RELEASE_DATE { get; set; }
		
		[XmlIgnore]
		public int? FLAGS { get; set; }
		[XmlAttribute("FLAGS")]
		public string FLAGSString
		{
			get { return FLAGS==null ? "" : FLAGS.Value.ToString(CultureInfo.InvariantCulture); }
			set
			{
				if (String.IsNullOrWhiteSpace(value)) FLAGS = null;
				else FLAGS = int.Parse(value);
			}
		}
		
		[XmlIgnore]
		public int? FILESIZE { get; set; }
		[XmlAttribute("FILESIZE")]
		public string FILESIZEString
		{
			get { return FILESIZE==null ? "" : FILESIZE.Value.ToString(CultureInfo.InvariantCulture); }
			set
			{
				if (String.IsNullOrWhiteSpace(value)) FILESIZE = null;
				else FILESIZE = int.Parse(value);
			}
		}
		
		[XmlAttribute("LABEL")]
		public string LABEL { get; set; }
		
		[XmlAttribute("COMMENT")]
		public string COMMENT { get; set; }
		
		[XmlAttribute("COVERARTID")]
		public string COVERARTID { get; set; }
		
		[XmlIgnore]
		public int? PLAYCOUNT { get; set; }
		[XmlAttribute("PLAYCOUNT")]
		public string PLAYCOUNTString
		{
			get { return PLAYCOUNT==null ? "" : PLAYCOUNT.Value.ToString(CultureInfo.InvariantCulture); }
			set
			{
				if (String.IsNullOrWhiteSpace(value)) PLAYCOUNT = null;
				else PLAYCOUNT = int.Parse(value);
			}
		}
		
		[XmlAttribute("LAST_PLAYED")]
		public string LAST_PLAYED { get; set; }
		
		[XmlAttribute("REMIXER")]
		public string REMIXER { get; set; }
		
		[XmlAttribute("KEY_LYRICS")]
		public string KEY_LYRICS { get; set; }
		
		[XmlAttribute("PRODUCER")]
		public string PRODUCER { get; set; }
		
		[XmlIgnore]
		public int? RANKING { get; set; }
		[XmlAttribute("RANKING")]
		public string RANKINGString
		{
			get { return RANKING==null ? "" : RANKING.Value.ToString(CultureInfo.InvariantCulture); }
			set
			{
				if (String.IsNullOrWhiteSpace(value)) RANKING = null;
				else RANKING = int.Parse(value);
			}
		}
		
		// ELEMENTS
		[XmlText]
		public string Value { get; set; }
		
		// CONSTRUCTOR
		public INFO()
		{}
	}
}
